<template>
  <div class="cart-list">
    <scroll class="content" :pull-up-load="true" :probe-type="3" ref="scroll">
      <cart-list-item v-for="(item, index) in list" :key="index" :product="item"/>
    </scroll>
  </div>
</template>

<script>
import scroll from 'components/common/scroll/scroll'

import cartListItem from './cart_list_item.vue'

import { mapGetters } from 'vuex'

export default {
  name: "cart_list",
  components: {
    scroll,
    cartListItem
  },
  computed: {
    ...mapGetters({
      list: 'cartList'
    })
  },
  activated() {
    // 防止卡住
    this.$refs.scroll.scroll.refresh();
  }
}
</script>

<style scoped>
  .cart-list {
    height: calc(100% - 44px - 49px - 40px);
  }

  .content {
    position: absolute;
    top: 44px;
    right: 0;
    bottom: 89px;
    left: 0;
    overflow: hidden;
  }
</style>
